package com.sls.mall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sls.common.utils.PageUtils;
import com.sls.mall.product.entity.AttrEntity;
import com.sls.mall.product.vo.AttrGroupRelationVo;
import com.sls.mall.product.vo.AttrVo;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author Gesx
 * @email 759065243@qq.com
 * @date 2021-05-13 17:13:10
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryBasePage(Map<String, Object> params, Long catelogId, String attrType);

    AttrVo getDetailById(Long attrId);

    void saveSttr(AttrVo attr);

    void updateAttr(AttrVo attr);

    /**
     * 获取分组属性
     * @param attrGroupId
     * @return
     */
    List<AttrEntity> getRelationAttr(Long attrGroupId);

    /**
     * 删除属性关联
     * @param relationVos
     */
    void deleteRelation(List<AttrGroupRelationVo> relationVos);

    /**
     * 查询未关联的属性
     * @param params
     * @param attrGroupId
     * @return
     */
    PageUtils queryNoRelationAttrByPage(Map<String, Object> params, Long attrGroupId);

    /**
     * 查询所有可被检索的规格属性
     * @param attrIds
     * @return
     */
    List<Long> selectSearchAttrIds(List<Long> attrIds);
}

